<?php
// 修改课程状态
require_once("DButil.php");
$id = $_REQUEST["id"];
$status = $_REQUEST["status"];

if($status){
    $status = 0;
} else {
    $status = 1;
}

$sql = "update ...";

$arr = [
    "success" => true,
    "msg" => "课程状态修改成功",
    "data" => null
];

header("Access-Control-Allow-Origin:*");
header("Content-Type:application/json;charset=UTF-8");
echo json_encode($arr);
?>